<?php
/**
 * 招聘中心 列表文件
 *
 * @author		Arthur(ArthurXF@gmail.com)
 * @copyright	(c) 2006 by bizeway.com
 * @version		$Id$
 * @package		ArthurXF
 * @subpackage	brand
 */
require_once('config/config.inc.php');
require_once("class/brand.class.php");

$objWebInit = new brand();
//数据库连接参数
$objWebInit->setDBG($arrGPdoDB);
//smarty参数
$objWebInit->arrGSmarty = $arrGSmarty;
//翻页参数
$objWebInit->arrGPage = $arrGPage;
$objWebInit->db();

if(!is_array($arrMType)||empty($arrMType)){
	$arrMType = $objWebInit->getTypeList('where type_pass=1');
	$arrMType = $objWebInit->formatTypeList(0,$arrMType,false);
}

//不带产品数量
$arrInfoList = $objWebInit->getInfoList('','ORDER BY type_id,initial,sort DESC',0,0,'id,type_id,title,initial','',false);
$arrTemp = array();
foreach ($arrInfoList as $brandList) {
	foreach ($arrMType as $k=>$v){
		if(!is_array($v)){
			if($k == $brandList['type_id']){
				$arrTemp[$brandList['type_id']]['type_title'] = $v;
				$arrTemp[$brandList['type_id']]['type_id'] = $k;
			}
		}elseif($v['type_id'] == $brandList['type_id']) {
			$arrTemp[$brandList['type_id']]['type_title'] = $v['type_title'];
			$arrTemp[$brandList['type_id']]['type_id'] = $v['type_id'];
		}
	}
	$arrTemp[$brandList['type_id']]['child'][$brandList['initial']][] = $brandList;
}

//调用推荐品牌bloak
include '../brand/block/top.php';
//产品分类
include '../product/block/_menu.php';
//全站公用block
@include '../_block.php';

// 输出到模板
$arrMOutput["smarty_assign"]['arrInfoList'] = $arrTemp;
$arrMOutput["smarty_assign"]['strPage'] = $strPage;
$arrMOutput["smarty_assign"]['MAIN'] = $arrGSmarty['main_dir'].'index.html';
$objWebInit->output($arrMOutput);
?>